﻿//====================================================================
// Create by Daniel
// Copyright: YunStudio Inc.
// file： YCModuleArtical.cs
// project ：YunCMS
// Build time：2012-09-09
// modify:
// description:
// ===================================================================
using System;

namespace YunCMS.Model
{
    [Serializable]
    public class YCModule
    {

        #region fields

        protected int _id;
        protected int _categoryid;
        protected string _author = String.Empty;
        protected string _title = String.Empty;
        protected string _keywords = String.Empty;
        protected string _description = String.Empty;
        protected bool _ishomepage;
        protected DateTime? _addtime;
        protected DateTime? _updatetime;
        protected int? _access;
        protected int _hits;
        protected bool _ispopular;
        protected int? _diggtop;
        protected int? _diggstep;
        protected bool _active;
        protected string _lang = String.Empty;
        protected string _content = String.Empty;
        protected string _source = String.Empty;

        #endregion

        #region constructor

        public YCModule() { }

        #endregion

        #region properties
        ///<summary>
        ///ID
        ///</summary>
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }

        ///<summary>
        ///Author
        ///</summary>
        public string Author
        {
            get { return _author; }
            set { _author = value; }
        }
        ///<summary>
        ///Category's ID
        ///</summary>
        public int CategoryID
        {
            get { return _categoryid; }
            set { _categoryid = value; }
        }

        ///<summary>
        ///Title of this item
        ///</summary>
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        ///<summary>
        ///Keywords, split with ','
        ///</summary>
        public string Keywords
        {
            get { return _keywords; }
            set { _keywords = value; }
        }

        ///<summary>
        ///Description
        ///</summary>
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }


        ///<summary>
        ///Is pop to top page.
        ///</summary>
        public bool IsHomePage
        {
            get { return _ishomepage; }
            set { _ishomepage = value; }
        }

        ///<summary>
        ///Add time
        ///</summary>
        public DateTime? AddTime
        {
            get { return _addtime; }
            set { _addtime = value; }
        }

        ///<summary>
        ///Update time
        ///</summary>
        public DateTime? UpdateTime
        {
            get { return _updatetime; }
            set { _updatetime = value; }
        }

        ///<summary>
        ///Accessable of this item
        ///</summary>
        public int? Access
        {
            get { return _access; }
            set { _access = value; }
        }

        ///<summary>
        ///Hits
        ///</summary>
        public int Hits
        {
            get { return _hits; }
            set { _hits = value; }
        }

        ///<summary>
        ///Determine if it's popular or not
        ///</summary>
        public bool IsPopular
        {
            get { return _ispopular; }
            set { _ispopular = value; }
        }

        ///<summary>
        ///Digg top
        ///</summary>
        public int? DiggTop
        {
            get { return _diggtop; }
            set { _diggtop = value; }
        }

        ///<summary>
        ///Digg step
        ///</summary>
        public int? DiggStep
        {
            get { return _diggstep; }
            set { _diggstep = value; }
        }

        ///<summary>
        ///Active or Deactive
        ///</summary>
        public bool Active
        {
            get { return _active; }
            set { _active = value; }
        }

        ///<summary>
        ///Lang
        ///</summary>
        public string Lang
        {
            get { return _lang; }
            set { _lang = value; }
        }

        ///<summary>
        ///Content Html
        ///</summary>
        public string Content
        {
            get { return _content; }
            set { _content = value; }
        }


        ///<summary>
        ///文章来源
        ///</summary>
        public string Source
        {
            get { return _source; }
            set { _source = value; }
        }
	
        #endregion

        #region method

        public override bool Equals(object obj)
        {
            return this.ID.Equals((obj as YCModule).ID);
        }

        #endregion
    }
}
